{{csrf_field()}}

<div class="layui-form-item">
    <label for="" class="layui-form-label">名称：</label>
    <div class="layui-input-inline">
        <input type="text" name="name" value="{{ $dao->name ?? old('name') }}" lay-verify="required" placeholder="请输入权限名称" class="layui-input" >
        <input type="hidden" name="guard_name" value="web">
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">图片：</label>
    <div class="layui-input-inline">
        <div class="layui-img" style="display: none" id="cover-show">
            <input type="hidden" value="{{$dao->cover??''}}" name="cover" id="cover">
            <img src="{{$dao->cover??''}}" id="cover-img" class="layui-img-content" alt="">
            <div class="layui-img-delete" id="cover-del">
                <i class="layui-icon layui-icon-delete"></i>
            </div>
        </div>
        <div class="layui-img" id="cover-upload">
            <i class="layui-icon layui-icon-add-1 layui-img-icon"></i>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <label for="" class="layui-form-label">金额：</label>
    <div class="layui-input-inline">
        <input type="text" name="amount" value="{{ $dao->amount ?? old('amount') }}" lay-verify="required" placeholder="请输入默认金额" class="layui-input" >
        <input type="hidden" name="guard_name" value="web">
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="submit" class="layui-btn" lay-submit="" lay-filter="postForm">确 认</button>
        <a  class="layui-btn" href="javascript:void(0)" id="close" >关 闭</a>
    </div>
</div>


<style>
    .layui-img-list {
        display: flex;
    }
    .layui-img-list div {
        margin-right: 10px;
    }
    .layui-img{
        width: 8em;
        height: 8em;
        border:1px #e8e8e8 solid;
        padding: .5em;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    .layui-img-content{
        width: auto;
        height: auto;
        max-width: 8em;
        max-height: 8em;
    }
    .layui-img-delete{
        position: absolute;
        top:3px;
        right:5px;
        background-color: rgba(0,0,0,0.5);
        color: #fff;
        width: 20px;
        height: 20px;
        border-radius: 10px;
        line-height: 20px;
        text-align: center;
        cursor: pointer;
    }
    .layui-img-delete:hover{
        width: 22px;
        height: 22px;
        border-radius: 11px;
        line-height: 22px;
        top: 2px;
        right: 4px;
    }

    .layui-img-icon{
        font-size:40px;
    }
</style>